package cn.segment.core.seg;

import cn.segment.core.common.Configuration;
import cn.segment.core.dictionary.TreeBuild;

/**
 * 前后导初分基类
 * @author Huang Yue
 * @version 创建时间：2010-6-9 上午10:52:57
 */
public abstract class SegBasic
{
    protected Configuration conf = Configuration.create();
    protected TreeBuild dict;
    public static final double CONST_WORD = 10000d;
    public static final double CONST_CHAR = 5000d;
    
    protected SegBasic(){
        dict = conf.getDict();
    }
    
    /**
     * 对句子进行分词
     */
    public WordTeam seg(String line)
    {
        WordTeam segResult = new WordTeam();
        this.lineSeg(segResult, line, line.length() - 1);
        
        return segResult;
    }
    
    protected abstract void lineSeg(WordTeam segResult, String str, int index);
}
